package com.biao.threads_test;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class Test05_Service {
    // 这个注解等于开启了一个子线程
    @Async
    public void asyncLog() {
        try {
            Thread.sleep(2000);
            System.out.println("<2>");
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
